﻿using System;
using System.Collections;
using Huirui.Cavan.Domain.MainBoundedContext.SystemModule;
using Huirui.Cavan.Domain.Seedwork;
using System.Collections.Generic;

namespace Huirui.Cavan.Domain.MainBoundedContext.StockModule
{
	#region StockExchange

	/// <summary>
	/// StockExchange object for NHibernate mapped table 'StockExchange'.
	/// </summary>
    [Serializable]
	public class StockExchange : Persistent<string>
	{
		#region Member Variables
		protected DateTime _exchangeDate;
		protected int _number;
		protected string _remark;
		protected Corporation _corporation;
		protected Stock _stock;
		protected WareHouse _wareHouse;
        protected IList<StockExchangeDetail> _stockExchangeDetails;

		#endregion

		#region Constructors

		public StockExchange() { }

		public StockExchange( DateTime exchangeDate, int number, string remark, DateTime createDate, DateTime modifyDate, int editUser, byte[] version, Corporation corporation, Stock stock, WareHouse wareHouse )
		{
			this._exchangeDate = exchangeDate;
			this._number = number;
			this._remark = remark;
			this._createDate = createDate;
			this._modifyDate = modifyDate;
			this._editUser = editUser;
			this._version = version;
			this._corporation = corporation;
			this._stock = stock;
			this._wareHouse = wareHouse;
		}

		#endregion

		#region Public Properties

		public virtual DateTime ExchangeDate
		{
			get { return _exchangeDate; }
			set { _exchangeDate = value; }
		}

		public virtual int Number
		{
			get { return _number; }
			set { _number = value; }
		}

		public virtual string Remark
		{
			get { return _remark; }
			set
			{
				_remark = value;
			}
		}

		public virtual Corporation Corporation
		{
			get { return _corporation; }
			set { _corporation = value; }
		}

		public virtual Stock Stock
		{
			get { return _stock; }
			set { _stock = value; }
		}

		public virtual WareHouse WareHouse
		{
			get { return _wareHouse; }
			set { _wareHouse = value; }
		}

        public virtual IList<StockExchangeDetail> StockExchangeDetails
        {
            get
            {
                if (_stockExchangeDetails == null)
                {
                    _stockExchangeDetails = new List<StockExchangeDetail>();
                }
                return _stockExchangeDetails;
            }
            set { _stockExchangeDetails = value; }
        }

		#endregion
	}
	#endregion
}